3.5.36 \(\int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx\) [436]

3.5.36.1 Optimal result
3.5.36.2 Mathematica [A] (verified)
3.5.36.3 Rubi [A] (verified)
3.5.36.4 Maple [A] (verified)
3.5.36.5 Fricas [A] (verification not implemented)
3.5.36.6 Sympy [B] (verification not implemented)
3.5.36.7 Maxima [A] (verification not implemented)
3.5.36.8 Giac [A] (verification not implemented)
3.5.36.9 Mupad [B] (verification not implemented)

3.5.36.1 Optimal result

Integrand size = 25, antiderivative size = 144 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=\frac {9}{8} \left (12 c^2+16 c d+7 d^2\right ) x-\frac {3 \left (12 c^2+16 c d+7 d^2\right ) \cos (e+f x)}{2 f}-\frac {3 \left (12 c^2+16 c d+7 d^2\right ) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {(8 c-d) d \cos (e+f x) (3+3 \sin (e+f x))^2}{12 f}-\frac {d^2 \cos (e+f x) (3+3 \sin (e+f x))^3}{12 f} \]

output
1/8*a^2*(12*c^2+16*c*d+7*d^2)*x-1/6*a^2*(12*c^2+16*c*d+7*d^2)*cos(f*x+e)/f 
-1/24*a^2*(12*c^2+16*c*d+7*d^2)*cos(f*x+e)*sin(f*x+e)/f-1/12*(8*c-d)*d*cos 
(f*x+e)*(a+a*sin(f*x+e))^2/f-1/4*d^2*cos(f*x+e)*(a+a*sin(f*x+e))^3/a/f
 
3.5.36.2 Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.01 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=-\frac {3 \cos (e+f x) \left (6 \left (12 c^2+16 c d+7 d^2\right ) \arcsin \left (\frac {\sqrt {1-\sin (e+f x)}}{\sqrt {2}}\right )+\sqrt {\cos ^2(e+f x)} \left (16 \left (3 c^2+5 c d+2 d^2\right )+3 \left (4 c^2+16 c d+7 d^2\right ) \sin (e+f x)+16 d (c+d) \sin ^2(e+f x)+6 d^2 \sin ^3(e+f x)\right )\right )}{8 f \sqrt {\cos ^2(e+f x)}} \]

input
Integrate[(3 + 3*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^2,x]
 
output
(-3*Cos[e + f*x]*(6*(12*c^2 + 16*c*d + 7*d^2)*ArcSin[Sqrt[1 - Sin[e + f*x] 
]/Sqrt[2]] + Sqrt[Cos[e + f*x]^2]*(16*(3*c^2 + 5*c*d + 2*d^2) + 3*(4*c^2 + 
 16*c*d + 7*d^2)*Sin[e + f*x] + 16*d*(c + d)*Sin[e + f*x]^2 + 6*d^2*Sin[e 
+ f*x]^3)))/(8*f*Sqrt[Cos[e + f*x]^2])
 
3.5.36.3 Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.97, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3042, 3240, 3042, 3230, 3042, 3123}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^2dx\)

\(\Big \downarrow \) 3240

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^2 \left (a \left (4 c^2+3 d^2\right )+a (8 c-d) d \sin (e+f x)\right )dx}{4 a}-\frac {d^2 \cos (e+f x) (a \sin (e+f x)+a)^3}{4 a f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^2 \left (a \left (4 c^2+3 d^2\right )+a (8 c-d) d \sin (e+f x)\right )dx}{4 a}-\frac {d^2 \cos (e+f x) (a \sin (e+f x)+a)^3}{4 a f}\)

\(\Big \downarrow \) 3230

\(\displaystyle \frac {\frac {1}{3} a \left (12 c^2+16 c d+7 d^2\right ) \int (\sin (e+f x) a+a)^2dx-\frac {a d (8 c-d) \cos (e+f x) (a \sin (e+f x)+a)^2}{3 f}}{4 a}-\frac {d^2 \cos (e+f x) (a \sin (e+f x)+a)^3}{4 a f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {1}{3} a \left (12 c^2+16 c d+7 d^2\right ) \int (\sin (e+f x) a+a)^2dx-\frac {a d (8 c-d) \cos (e+f x) (a \sin (e+f x)+a)^2}{3 f}}{4 a}-\frac {d^2 \cos (e+f x) (a \sin (e+f x)+a)^3}{4 a f}\)

\(\Big \downarrow \) 3123

\(\displaystyle \frac {\frac {1}{3} a \left (12 c^2+16 c d+7 d^2\right ) \left (-\frac {2 a^2 \cos (e+f x)}{f}-\frac {a^2 \sin (e+f x) \cos (e+f x)}{2 f}+\frac {3 a^2 x}{2}\right )-\frac {a d (8 c-d) \cos (e+f x) (a \sin (e+f x)+a)^2}{3 f}}{4 a}-\frac {d^2 \cos (e+f x) (a \sin (e+f x)+a)^3}{4 a f}\)

input
Int[(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^2,x]
 
output
-1/4*(d^2*Cos[e + f*x]*(a + a*Sin[e + f*x])^3)/(a*f) + (-1/3*(a*(8*c - d)* 
d*Cos[e + f*x]*(a + a*Sin[e + f*x])^2)/f + (a*(12*c^2 + 16*c*d + 7*d^2)*(( 
3*a^2*x)/2 - (2*a^2*Cos[e + f*x])/f - (a^2*Cos[e + f*x]*Sin[e + f*x])/(2*f 
)))/3)/(4*a)
 

3.5.36.3.1 Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3123
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(2*a^2 + b^ 
2)*(x/2), x] + (-Simp[2*a*b*(Cos[c + d*x]/d), x] - Simp[b^2*Cos[c + d*x]*(S 
in[c + d*x]/(2*d)), x]) /; FreeQ[{a, b, c, d}, x]
 

rule 3230
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( 
f*(m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(b*(m + 1))   Int[(a + b*Sin[e 
 + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] 
&& EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)]
 

rule 3240
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + ( 
f_.)*(x_)])^2, x_Symbol] :> Simp[(-d^2)*Cos[e + f*x]*((a + b*Sin[e + f*x])^ 
(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2))   Int[(a + b*Sin[e + f*x])^ 
m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x] 
, x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ 
[a^2 - b^2, 0] &&  !LtQ[m, -1]
 
3.5.36.4 Maple [A] (verified)

Time = 1.81 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.75

method result size
parallelrisch \(\frac {\left (\left (-8 c^{2}-32 c d -16 d^{2}\right ) \sin \left (2 f x +2 e \right )+\frac {16 d \left (c +d \right ) \cos \left (3 f x +3 e \right )}{3}+d^{2} \sin \left (4 f x +4 e \right )-64 \left (c +d \right ) \left (c +\frac {3 d}{4}\right ) \cos \left (f x +e \right )+\left (28 f x -\frac {128}{3}\right ) d^{2}+c \left (64 f x -\frac {320}{3}\right ) d +\left (48 f x -64\right ) c^{2}\right ) a^{2}}{32 f}\) \(108\)
parts \(a^{2} c^{2} x -\frac {\left (2 a^{2} c d +2 d^{2} a^{2}\right ) \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3 f}-\frac {\left (2 a^{2} c^{2}+2 a^{2} c d \right ) \cos \left (f x +e \right )}{f}+\frac {\left (a^{2} c^{2}+4 a^{2} c d +d^{2} a^{2}\right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {d^{2} a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}\) \(165\)
risch \(\frac {3 a^{2} c^{2} x}{2}+2 a^{2} c d x +\frac {7 a^{2} d^{2} x}{8}-\frac {2 a^{2} \cos \left (f x +e \right ) c^{2}}{f}-\frac {7 a^{2} \cos \left (f x +e \right ) c d}{2 f}-\frac {3 a^{2} \cos \left (f x +e \right ) d^{2}}{2 f}+\frac {d^{2} a^{2} \sin \left (4 f x +4 e \right )}{32 f}+\frac {a^{2} d \cos \left (3 f x +3 e \right ) c}{6 f}+\frac {a^{2} d^{2} \cos \left (3 f x +3 e \right )}{6 f}-\frac {\sin \left (2 f x +2 e \right ) a^{2} c^{2}}{4 f}-\frac {\sin \left (2 f x +2 e \right ) a^{2} c d}{f}-\frac {\sin \left (2 f x +2 e \right ) d^{2} a^{2}}{2 f}\) \(196\)
derivativedivides \(\frac {a^{2} c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 a^{2} c d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+d^{2} a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-2 a^{2} c^{2} \cos \left (f x +e \right )+4 a^{2} c d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 d^{2} a^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+a^{2} c^{2} \left (f x +e \right )-2 a^{2} c d \cos \left (f x +e \right )+d^{2} a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) \(219\)
default \(\frac {a^{2} c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 a^{2} c d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+d^{2} a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-2 a^{2} c^{2} \cos \left (f x +e \right )+4 a^{2} c d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 d^{2} a^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+a^{2} c^{2} \left (f x +e \right )-2 a^{2} c d \cos \left (f x +e \right )+d^{2} a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) \(219\)
norman \(\frac {\left (\frac {3}{2} a^{2} c^{2}+2 a^{2} c d +\frac {7}{8} d^{2} a^{2}\right ) x +\left (6 a^{2} c^{2}+8 a^{2} c d +\frac {7}{2} d^{2} a^{2}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (6 a^{2} c^{2}+8 a^{2} c d +\frac {7}{2} d^{2} a^{2}\right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (9 a^{2} c^{2}+12 a^{2} c d +\frac {21}{4} d^{2} a^{2}\right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (\frac {3}{2} a^{2} c^{2}+2 a^{2} c d +\frac {7}{8} d^{2} a^{2}\right ) x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {12 a^{2} c^{2}+20 a^{2} c d +8 d^{2} a^{2}}{3 f}-\frac {4 \left (a^{2} c^{2}+a^{2} c d \right ) \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (6 a^{2} c^{2}+10 a^{2} c d +4 d^{2} a^{2}\right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {4 \left (9 a^{2} c^{2}+17 a^{2} c d +8 d^{2} a^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {a^{2} \left (4 c^{2}+16 c d +7 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {a^{2} \left (4 c^{2}+16 c d +7 d^{2}\right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}-\frac {a^{2} \left (4 c^{2}+16 c d +15 d^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}+\frac {a^{2} \left (4 c^{2}+16 c d +15 d^{2}\right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{4}}\) \(465\)

input
int((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)
 
output
1/32*((-8*c^2-32*c*d-16*d^2)*sin(2*f*x+2*e)+16/3*d*(c+d)*cos(3*f*x+3*e)+d^ 
2*sin(4*f*x+4*e)-64*(c+d)*(c+3/4*d)*cos(f*x+e)+(28*f*x-128/3)*d^2+c*(64*f* 
x-320/3)*d+(48*f*x-64)*c^2)*a^2/f
 
3.5.36.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.01 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=\frac {16 \, {\left (a^{2} c d + a^{2} d^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (12 \, a^{2} c^{2} + 16 \, a^{2} c d + 7 \, a^{2} d^{2}\right )} f x - 48 \, {\left (a^{2} c^{2} + 2 \, a^{2} c d + a^{2} d^{2}\right )} \cos \left (f x + e\right ) + 3 \, {\left (2 \, a^{2} d^{2} \cos \left (f x + e\right )^{3} - {\left (4 \, a^{2} c^{2} + 16 \, a^{2} c d + 9 \, a^{2} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \]

input
integrate((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^2,x, algorithm="fricas")
 
output
1/24*(16*(a^2*c*d + a^2*d^2)*cos(f*x + e)^3 + 3*(12*a^2*c^2 + 16*a^2*c*d + 
 7*a^2*d^2)*f*x - 48*(a^2*c^2 + 2*a^2*c*d + a^2*d^2)*cos(f*x + e) + 3*(2*a 
^2*d^2*cos(f*x + e)^3 - (4*a^2*c^2 + 16*a^2*c*d + 9*a^2*d^2)*cos(f*x + e)) 
*sin(f*x + e))/f
 
3.5.36.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 459 vs. \(2 (143) = 286\).

Time = 0.26 (sec) , antiderivative size = 459, normalized size of antiderivative = 3.19 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=\begin {cases} \frac {a^{2} c^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a^{2} c^{2} x \cos ^{2}{\left (e + f x \right )}}{2} + a^{2} c^{2} x - \frac {a^{2} c^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {2 a^{2} c^{2} \cos {\left (e + f x \right )}}{f} + 2 a^{2} c d x \sin ^{2}{\left (e + f x \right )} + 2 a^{2} c d x \cos ^{2}{\left (e + f x \right )} - \frac {2 a^{2} c d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{2} c d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 a^{2} c d \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {2 a^{2} c d \cos {\left (e + f x \right )}}{f} + \frac {3 a^{2} d^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {3 a^{2} d^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {a^{2} d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a^{2} d^{2} x \cos ^{4}{\left (e + f x \right )}}{8} + \frac {a^{2} d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {5 a^{2} d^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {2 a^{2} d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {3 a^{2} d^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {a^{2} d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {4 a^{2} d^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (c + d \sin {\left (e \right )}\right )^{2} \left (a \sin {\left (e \right )} + a\right )^{2} & \text {otherwise} \end {cases} \]

input
integrate((a+a*sin(f*x+e))**2*(c+d*sin(f*x+e))**2,x)
 
output
Piecewise((a**2*c**2*x*sin(e + f*x)**2/2 + a**2*c**2*x*cos(e + f*x)**2/2 + 
 a**2*c**2*x - a**2*c**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*a**2*c**2*cos 
(e + f*x)/f + 2*a**2*c*d*x*sin(e + f*x)**2 + 2*a**2*c*d*x*cos(e + f*x)**2 
- 2*a**2*c*d*sin(e + f*x)**2*cos(e + f*x)/f - 2*a**2*c*d*sin(e + f*x)*cos( 
e + f*x)/f - 4*a**2*c*d*cos(e + f*x)**3/(3*f) - 2*a**2*c*d*cos(e + f*x)/f 
+ 3*a**2*d**2*x*sin(e + f*x)**4/8 + 3*a**2*d**2*x*sin(e + f*x)**2*cos(e + 
f*x)**2/4 + a**2*d**2*x*sin(e + f*x)**2/2 + 3*a**2*d**2*x*cos(e + f*x)**4/ 
8 + a**2*d**2*x*cos(e + f*x)**2/2 - 5*a**2*d**2*sin(e + f*x)**3*cos(e + f* 
x)/(8*f) - 2*a**2*d**2*sin(e + f*x)**2*cos(e + f*x)/f - 3*a**2*d**2*sin(e 
+ f*x)*cos(e + f*x)**3/(8*f) - a**2*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 
 4*a**2*d**2*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(c + d*sin(e))**2*(a*sin 
(e) + a)**2, True))
 
3.5.36.7 Maxima [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.47 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=\frac {24 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} c^{2} + 96 \, {\left (f x + e\right )} a^{2} c^{2} + 64 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} c d + 96 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} c d + 64 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} d^{2} + 3 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} d^{2} + 24 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} d^{2} - 192 \, a^{2} c^{2} \cos \left (f x + e\right ) - 192 \, a^{2} c d \cos \left (f x + e\right )}{96 \, f} \]

input
integrate((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^2,x, algorithm="maxima")
 
output
1/96*(24*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*c^2 + 96*(f*x + e)*a^2*c^2 + 
 64*(cos(f*x + e)^3 - 3*cos(f*x + e))*a^2*c*d + 96*(2*f*x + 2*e - sin(2*f* 
x + 2*e))*a^2*c*d + 64*(cos(f*x + e)^3 - 3*cos(f*x + e))*a^2*d^2 + 3*(12*f 
*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*a^2*d^2 + 24*(2*f*x + 2 
*e - sin(2*f*x + 2*e))*a^2*d^2 - 192*a^2*c^2*cos(f*x + e) - 192*a^2*c*d*co 
s(f*x + e))/f
 
3.5.36.8 Giac [A] (verification not implemented)

Time = 0.49 (sec) , antiderivative size = 202, normalized size of antiderivative = 1.40 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=-\frac {2 \, a^{2} c d \cos \left (f x + e\right )}{f} + \frac {a^{2} d^{2} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {a^{2} d^{2} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} + \frac {1}{8} \, {\left (4 \, a^{2} c^{2} + 16 \, a^{2} c d + 3 \, a^{2} d^{2}\right )} x + \frac {1}{2} \, {\left (2 \, a^{2} c^{2} + a^{2} d^{2}\right )} x + \frac {{\left (a^{2} c d + a^{2} d^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{6 \, f} - \frac {{\left (4 \, a^{2} c^{2} + 3 \, a^{2} c d + 3 \, a^{2} d^{2}\right )} \cos \left (f x + e\right )}{2 \, f} - \frac {{\left (a^{2} c^{2} + 4 \, a^{2} c d + a^{2} d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]

input
integrate((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^2,x, algorithm="giac")
 
output
-2*a^2*c*d*cos(f*x + e)/f + 1/32*a^2*d^2*sin(4*f*x + 4*e)/f - 1/4*a^2*d^2* 
sin(2*f*x + 2*e)/f + 1/8*(4*a^2*c^2 + 16*a^2*c*d + 3*a^2*d^2)*x + 1/2*(2*a 
^2*c^2 + a^2*d^2)*x + 1/6*(a^2*c*d + a^2*d^2)*cos(3*f*x + 3*e)/f - 1/2*(4* 
a^2*c^2 + 3*a^2*c*d + 3*a^2*d^2)*cos(f*x + e)/f - 1/4*(a^2*c^2 + 4*a^2*c*d 
 + a^2*d^2)*sin(2*f*x + 2*e)/f
 
3.5.36.9 Mupad [B] (verification not implemented)

Time = 8.74 (sec) , antiderivative size = 440, normalized size of antiderivative = 3.06 \[ \int (3+3 \sin (e+f x))^2 (c+d \sin (e+f x))^2 \, dx=\frac {a^2\,\mathrm {atan}\left (\frac {a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (12\,c^2+16\,c\,d+7\,d^2\right )}{4\,\left (3\,a^2\,c^2+4\,a^2\,c\,d+\frac {7\,a^2\,d^2}{4}\right )}\right )\,\left (12\,c^2+16\,c\,d+7\,d^2\right )}{4\,f}-\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a^2\,c^2+4\,a^2\,c\,d+\frac {7\,a^2\,d^2}{4}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7\,\left (a^2\,c^2+4\,a^2\,c\,d+\frac {7\,a^2\,d^2}{4}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (a^2\,c^2+4\,a^2\,c\,d+\frac {15\,a^2\,d^2}{4}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\,\left (a^2\,c^2+4\,a^2\,c\,d+\frac {15\,a^2\,d^2}{4}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (12\,a^2\,c^2+20\,a^2\,c\,d+8\,a^2\,d^2\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (12\,a^2\,c^2+\frac {68\,a^2\,c\,d}{3}+\frac {32\,a^2\,d^2}{3}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (4\,a^2\,c^2+4\,d\,a^2\,c\right )+4\,a^2\,c^2+\frac {8\,a^2\,d^2}{3}+\frac {20\,a^2\,c\,d}{3}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}-\frac {a^2\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\frac {f\,x}{2}\right )\,\left (12\,c^2+16\,c\,d+7\,d^2\right )}{4\,f} \]

input
int((a + a*sin(e + f*x))^2*(c + d*sin(e + f*x))^2,x)
 
output
(a^2*atan((a^2*tan(e/2 + (f*x)/2)*(16*c*d + 12*c^2 + 7*d^2))/(4*(3*a^2*c^2 
 + (7*a^2*d^2)/4 + 4*a^2*c*d)))*(16*c*d + 12*c^2 + 7*d^2))/(4*f) - (tan(e/ 
2 + (f*x)/2)*(a^2*c^2 + (7*a^2*d^2)/4 + 4*a^2*c*d) - tan(e/2 + (f*x)/2)^7* 
(a^2*c^2 + (7*a^2*d^2)/4 + 4*a^2*c*d) + tan(e/2 + (f*x)/2)^3*(a^2*c^2 + (1 
5*a^2*d^2)/4 + 4*a^2*c*d) - tan(e/2 + (f*x)/2)^5*(a^2*c^2 + (15*a^2*d^2)/4 
 + 4*a^2*c*d) + tan(e/2 + (f*x)/2)^4*(12*a^2*c^2 + 8*a^2*d^2 + 20*a^2*c*d) 
 + tan(e/2 + (f*x)/2)^2*(12*a^2*c^2 + (32*a^2*d^2)/3 + (68*a^2*c*d)/3) + t 
an(e/2 + (f*x)/2)^6*(4*a^2*c^2 + 4*a^2*c*d) + 4*a^2*c^2 + (8*a^2*d^2)/3 + 
(20*a^2*c*d)/3)/(f*(4*tan(e/2 + (f*x)/2)^2 + 6*tan(e/2 + (f*x)/2)^4 + 4*ta 
n(e/2 + (f*x)/2)^6 + tan(e/2 + (f*x)/2)^8 + 1)) - (a^2*(atan(tan(e/2 + (f* 
x)/2)) - (f*x)/2)*(16*c*d + 12*c^2 + 7*d^2))/(4*f)